import request from './request'
import request2 from './request2'

// 用户登录
export function login(data) {
  return request2({
    url: '/web_user/api/user/login',
    method: 'post',
    data
  })
}
// 用户注册
export function register(data) {
  return request2({
    url: '/web_user/api/user/register',
    method: 'post',
    data
  })
}
// 获取扭蛋分类
export function boxType() {
  return request({
    url: '/mystery_box/api/boxType/list',
    method: 'get',
  })
}
// 获取扭蛋列表
export function boxList(data) {
  return request({
    url: '/mystery_box/api/box/list',
    method: 'post',
    data
  })
}
// 获取扭蛋详情
export function boxListDetail(data) {
  return request2({
    url: `/mystery_box/api/box/getDetail?boxId=${data.boxId}`,
    method: 'get',
  })
}
// 礼品库
export function giftList(data) {
  return request({
    url: '/mystery_box/api/gift/list',
    method: 'post',
    data
  })
}
// 礼品库详情
export function giftListDetail(data) {
  return request({
    url:  `/mystery_box/api/gift/getDetailById?giftId=${data.giftId}`,
    method: 'get',
  })
}
// 扭蛋购买

export function buyEgg(data) {
  return request2({
    url:  `/box_order/api/boxOrder/purchase?boxId=${data.boxId}`,
    method: 'put',
  
  })
}
// 扭蛋订单列表

export function findBoxOrderPage(data) {
  return request({
    url:  `/box_order/api/boxOrder/findBoxOrderPage`,
    method: 'post',
    data
  })
}

// 获取用户当前收货地址
export function getCurUserShipAddress(){
  return request({
    url:  `/wallet/api/userShipAddress/getCurUserShipAddress`,
    method: 'get',
  })
}
// 设置用户当前收货地址
export function setCurUserShipAddress(data){
  return request2({
    url:  `/wallet/api/userShipAddress/setCurUserShipAddress`,
    method: 'post',
    data
  })
}
// 获取用户未兑换的礼品 分页列表
export function findToBeRedeemedPage(data){
  return request2({
    url:  `/user_gifts/api/userGifts/findToBeRedeemedPage`,
    method: 'post',
    data
  })
}

// 常见问题列表
export function faqList(){
  return request({
    url:  `/other/api/faq/selAllList`,
    method: 'get',
  })
}
// 首页 常见问题列表
export function faqHomeList(){
  return request({
    url:  `/other/api/faq/selRecList`,
    method: 'get',
  })
}
// 修改密码

export function editPwd(data) {
  return request2({
    url:  `/web_user/api/user/changePassword?newPassword=${data.newPassword}`,
    method: 'put',
  
  })
}
// 立即提货

export function physicalItemPickup(data){
  return request2({
    url:  `/user_gifts/api/userGifts/physicalItemPickup?userGiftsId=${data.userGiftsId}`,
    method: 'post',
  })
}
// 获取评审推荐列表（首页展示）
export function reviewList(){
  return request({
    url:'/customer/api/customerReviews/toppingList',
    method:'get'
  })
}
// 获取评审推荐列表
export function reviewList2(data){
  return request({
    url:'/customer/api/customerReviews/list',
    method:'post',
    data,
  })
}
// 兑换虚拟币
export function platformVirtualCurrencyExchange(data){
  return request2({
    url:`/user_gifts/api/userGifts/platformVirtualCurrencyExchange?userGiftsId=${data.userGiftsId}`,
    method:'post',
  })
}
// 获取出货量列表
export function findUserShipmentsPage(data){
  return request2({
    url:`/user_gifts/api/userGifts/findUserShipmentsPage`,
    method:'post',
    data
  })
}

// 获取用户钱包信息
export function getUserWallet(){
  return request2({
    url:'/wallet/api/userWallet/getUserWallet',
    method:'get'
  })
}
// 获取用户信息
export function getUserInfo(){
  return request2({
    url:'/web_user/api/user/getUserInfo',
    method:'post'
  })
}
// 修改用户基本信息
export function changeUserBasisInfo(data){
  return request2({
    url:'/web_user/api/user/changeUserBasisInfo',
    method:'post',
    data
  })
}
// 获取基础公共配置
export function getBasisSetting(){
  return request2({
    url:'/sys_cus/api/sysCommonSetting/getBasisSetting',
    method:'get',
  })
}
// 获取数据统计
export function getWebDataStatistics(){
  return request2({
    url:'/analysis/api/dataStatistics/getWebDataStatistics',
    method:'get',
  })
}
// 获取实时扭蛋列表
export function getLiveUnBoxingList(){
  return request2({
    url:'/mystery_box/api/box/getLiveUnBoxingList',
    method:'get',
  })
}
// 获取文章详情
export function getByTypeCode(data){
  return request2({
    url:`/other/api/article/getByTypeCode?typeCode=${data.typeCode}`,
    method:'get',
  })
}
// 订单确认收货
export function confirmReceipt(data){
  return request2({
    url:`/user_gifts/api/userGifts/confirmReceipt?exchangeRecordId=${data.exchangeRecordId}`,
    method:'put',
  })
}
// 修改头像
export function editAvatar(data){
  return request2({
    url:`/web_user/api/user/changeHeadPortrait`,
    method:'post',
    data
  })
}
